1. Field of the Invention
The present invention relates to a vertex data access apparatus and method, and particularly to a vertex data access apparatus and method that fetches vertex data from system memory according to vertex index and employs a vertex data queue to perform vertex cache function.
2. Description of the Related Art
A computer graphics accelerating system receives vertex data to produce a two-dimensional image of a scene or an object from a description or model of the object. The vertex data is usually settled in the system memory. One method for transferring the vertex data from system memory to the graphics accelerating system is that a vertex index is transferred first, and the graphics accelerating system according the vertex index sends an access request, and the vertex data is readied and returned. The method is referred as xe2x80x9cIndex Modexe2x80x9d.
FIG. 1 is a simplified block diagram illustrating the graphics accelerating system 10 accessing the vertex data 31 in system memory 30 by way of an interface controller 20. The interface controller 20 comprises a request queue 21 and a vertex data queue 22. The request queue 21 stores memory requests generated by graphics accelerating system 10. The vertex data queue 22 stores vertex data 31 transferred from system memory 30 to later be fetched by the graphics accelerating system 10.
The transfer procedure is a split bus transaction protocol as illustrated in following steps:
Step 1. A vertex index is received.
Step 2. A request is sent and stored into a request queue.
Step 3. A request for access vertex data and is issued and removed from the request queue if the bus is available.
Step 4. After the vertex data is ready, it returned and stored into vertex data queue if the bus is available.
Step 5. If the graphics accelerating system needs the vertex data for further processing, access is performed and the vertex data is fetched from the vertex data queue.
It should be noted that the reuse of vertex data may take place. That is, a vertex cache can be adopted for improving performance in the graphics accelerating system. However, vertex data comprises screen coordinates, depth information, color information including red, green and blue, transparent factor, specular color information including specular red, specular green and specular blue, fog factor, and several sets of texture coordinates, storage of which can severely tax reaources.
It is therefore an object of the present invention to provide a vertex data access apparatus and method to utilize the vertex data queue for implementing the vertex cache to reduce the storage cost.
To achieve the above object, the present invention provides a vertex data access apparatus and method. According to one embodiment of the invention, the vertex data access apparatus includes an interface controller and a vertex data queue controller. The vertex data queue controller includes a limit counter, an available counter, an index comparator unit, a request controller and an access controller.
The limit counter records the number of requests issued. The available counter records the amount of return vertex data in vertex data queue not yet read. The index comparator unit is responsible for finding out whether the input vertex index is the same as any one index in an vertex index register, and report a corresponding result to the request controller. The request controller determines to send a vertex data request to the interface controller according to the result received from the index comparator unit and the value of the limit counter, and then stores the result into a reference register.
If a vertex data read signal is received by the access controller, the access controller reads the result stored in the reference register and accesses the vertex data from the vertex data queue according to the result and the value of the available counter.
Further, according to a second embodiment of the invention, a vertex data accessing method is provided. First, a vertex index is received. Then, a vertex data request corresponding to the vertex index is assessed to send according to the vertex index for fetching vertex data according to the vertex data request and store the vertex data into a vertex data queue.
Thereafter, the state of the vertex data queue is monitored. If a vertex data read signal is received, the vertex data is accessed from the vertex data queue according to the state of the vertex data queue.